# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
# Maintainer: Johannes Matheis <jomat+alpinebuild@jmt.gr>
pkgname=pass
pkgver=1.7.3
pkgrel=2
pkgdesc="Stores, retrieves, generates, and synchronizes passwords securely"
url="https://www.passwordstore.org"
arch="noarch"
license="GPL-2.0-or-later"
depends="bash tree cmd:gpg2"
makedepends="gnupg"
checkdepends="git"
subpackages="$pkgname-doc
	$pkgname-contrib
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://git.zx2c4.com/password-store/snapshot/password-store-$pkgver.tar.xz
	fix-password-generation.patch
	README.alpine
	"
builddir="$srcdir/password-store-$pkgver"

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" WITH_ALLCOMP=yes install
	install -Dm 644 "$srcdir"/README.alpine "$pkgdir"/usr/share/doc/pass/README.alpine

	mkdir -p "$pkgdir"/usr/share/fish
	mv "$pkgdir"/usr/share/fish/vendor_completions.d "$pkgdir"/usr/share/fish/completions
}

contrib() {
	pkgdesc="contrib files for pass"
	mkdir -p "$subpkgdir"/usr/share
	cp -a "$builddir"/contrib "$subpkgdir"/usr/share/$pkgname
}

sha512sums="89755a7b02f05d75055a9fc14fd3f456c0a49ec31bdffd097a027f91228c64a98b18c1e80017aeda811773ae3287ff1b9737532da8ded06799d8fe3979ca06f7  password-store-1.7.3.tar.xz
fb2d78975041197f5e9ace5dc2ac8f2de46ebd43ca08c65a527c8c5e5128f0e6baa64a7d994c393777b8a6ddf987f275f815db11359bb787faa89875a508c291  fix-password-generation.patch
eca180d02af608b18a2b6d4b0eaa685c9b1bb8d2ccde921fb27cc12d6d4c31551c6b69fc2ddd2baaa840630ba3c8c0c44ee40b612e8dc004c2b90aafd299a4fa  README.alpine"
